<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head></h:head>
<h:body>
	<ui:composition template="/template.xhtml">
		<ui:define name="corpo">
			<h:form id="formDuvidasResponder">
				<p:dataTable paginator="true" paginatorAlwaysVisible="false" id="tblDuvidas" var="duvida" 
				value="#{duvidaBean.duvidas}" emptyMessage="Nenhum registro encontrado">					
					<f:facet name="header">Dúvidas em aberto</f:facet>
					
					<p:column headerText="Titulo">
						<h:outputText value="#{duvida.titulo}" />
					</p:column>

					<p:column headerText="Data">
						<h:outputText value="#{duvida.data}">
							<f:convertDateTime pattern="dd/MM/yyyy" />
						</h:outputText>
					</p:column>

					<p:column headerText="Autor">
						<h:outputText value="#{duvida.professor.nome}" />
					</p:column>

					<p:column style="width:4%" headerText="Responder">
						<p:commandButton id="btResponder" value="Responder" action="/pagina-responder.xhtml">
							<f:setPropertyActionListener value="#{duvida}" target="#{respostaBean.duvida}" />
						</p:commandButton>		
					</p:column>
					
				</p:dataTable>
			</h:form>				
		</ui:define>
	</ui:composition>
</h:body>
</html>
